package com.serviceImpl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dao.StaffDao;
import com.domain.Staff;
import com.service.StaffService;
import com.util.PageBean;
@Service(value="staffService")
@Transactional
public class StaffServiceImpl implements StaffService {
	@Resource(name="staffDao")
	private StaffDao staffDao;
	@Override
	public void save(Staff model) {
		
		staffDao.save(model);
	}

	@Override
	public PageBean findAllStaff(PageBean pageBean) {
		return staffDao.pageQuery(pageBean);
	}

	@Override
	public void deleteStaff(String ids) {
			String[] strings = ids.split(",");//切分字符串,获取所有的id
			for (String s : strings) {
				Staff staff = staffDao.findById(s);
				staff.setDeltag('1');//1为删除
			}
	}

	@Override
	public void updateStaff(Staff model) {
		staffDao.save(model);				//修改派件员后保存数据
		
	}

}
